package 面试;

import java.util.concurrent.atomic.AtomicInteger;

public class CASdemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);


        System.out.println(atomicInteger.compareAndSet(5, 2019) + " " + atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(5, 1024) + " " + atomicInteger.get());
    }
}
